package lib.bone.nepudata.dao;

import lib.bone.nepudata.domain.entity.NepuTopic;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

/**
 * @Author : cg
 * @Date : 2021-1-12
 */


@Repository
public interface NepuTopicDAO extends JpaRepository<NepuTopic,String> {
    /**
     * 判断是否存在对应词典ID 的课题
     * @param topicDictId
     * @return
     */
    Boolean existsByTopicDictId(String topicDictId);
    /**
     * 根据课题编码查询
     */
    List<NepuTopic> findByTopicCode(String topicCode);

    List<NepuTopic> findByTopicName(String name);

    @Transactional
    void deleteByIdIn(List<String> ids);

    List<NepuTopic> findByIdIn(List<String> ids);


}
